/**
 * 
 */
package com.rd.sys.common.utils;

import com.rd.sys.dto.commmon.enums.OperateLogEnum;

/**
 * @author
 */
public final class OperateLogUtils {
    /**
     * Find operate log type by code.
     * 
     * @param code
     *            the code
     * @return the string
     * @throws Exception
     *             the exception
     * @version
     */
    public static String findOperateLogTypeByCode(String code) throws Exception {
        for (OperateLogEnum.System system : OperateLogEnum.System.values()) {
            if (system.getCode().equals(code)) {
                return system.getName();
            }
        }
        for (OperateLogEnum.User operator : OperateLogEnum.User.values()) {
            if (operator.getCode().equals(code)) {
                return operator.getName();
            }
        }

        return "";
    }
}
